package com.yupi.project.controller;

import com.yupi.project.annotation.AuthCheck;
import com.yupi.project.common.BaseResponse;
import com.yupi.project.common.ResultUtils;
import com.yupi.project.model.vo.InterfaceInfoVO;
import com.yupi.project.service.UserInterfaceInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author vvv
 * @date 2023-10-09 12 13
 * discription
 */
@RestController
@RequestMapping("/analysis")
public class AnalysisController {

    @Resource
    private UserInterfaceInfoService userInterfaceInfoService;

    @GetMapping("/top/interface/invoke")
    @AuthCheck(mustRole = "admin")
    public BaseResponse<List<InterfaceInfoVO>> listTopInvokeInterfaceInfo() {
        List<InterfaceInfoVO> topInvokeInterfaceInfoList
                = userInterfaceInfoService.listTopInvokeInterfaceInfo();
        return ResultUtils.success(topInvokeInterfaceInfoList);
    }
}
